package com.shop.shoporder.service.impl;

import com.shop.shoporder.entity.Goods;
import com.shop.shoporder.mapper.GoodsMapper;
import com.shop.shoporder.mapper.GoodsMapperCustom;
import com.shop.shoporder.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("GoodsServiceImpl")
public class GoodsServiceImpl  implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Autowired
    private GoodsMapperCustom goodsMapperCustom;

    @Override
    public Goods selectByPrimaryKey(int id)
    {
        return goodsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Goods> selectAll(Goods record)
    {
        return goodsMapperCustom.selectAll(record);
    }

    @Override
    public int insertSelective(Goods record)
    {
        return goodsMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Goods record){return goodsMapper.updateByPrimaryKeySelective(record);}

    @Override
    public List<Goods> selectSupplier() {
        return goodsMapper.selectSupplier();
    }

}
